#include<iostream>
using namespace std;
int flag;
int n;
int t[11], d[11], l[11];
int used[11];
void dfs(int x, int tim)
{
	if (flag)return;
	if (x == n)
	{
		flag = 1;
		return;

	}
	for (int i = 0; i < n; i++)
	{
		if (!used[i] && tim <= t[i] + d[i])
		{
			used[i] = 1;
			dfs(x + 1, max(tim, t[i]) + l[i]);
			if (flag)return;
			used[i] = 0;


		}





	}





}
int main()
{
	int T;
	cin >> T;
	while (T--)
	{
		//int n;
		flag = 0;
		cin >> n;
		for (int i = 0; i < n; i++)
		{
			cin >> t[i] >> d[i] >> l[i];
			used[i] = 0;
		}
		dfs(0, 0);
		if (flag) cout << "YES\n";
		else cout << "NO\n";
	}
	






}
